package com.yangchao.ch03

class example4 {
    /** 写入文件 **/
    public static void main(String[] args) {
        writefile()
    }
    static void writefile(){
        new File("C:\\Users\\Administrator\\Desktop\\groovy_entry_to_mastery\\09文件与IO\\temp\\temp2.txt").withWriter {
            writer ->
                //循环十次写入
                for ( int i =0;i<10;i++){
                    writer.writeLine("你好! Groovy @@@#...${i}")
                }
        }
    }
}
